<?
/*
 * @name header.php
 * @creater Charles Koh
 */
	session_start();
	$g_userId = $_SESSION['userid'];
?>
<html>
	<script type="text/javascript" src="/xp/js/common.js"></script>
	<head>
		<link rel="stylesheet" href="css/header.css"/>
		<script>
		function logout() {
			ajax.request({
				url:"server/session_out.php",
				successCB: function() {
					alert("Success to Log-out.");
					top.location.reload();
				},
				failCB: function() {
					alert("Fail to Log-out");
				}
			})
			
		}
		</script>
	</head>
	<body>
		<a href="main.php" target="content">Logo</a>
		<div id="main_state">
			<div>
				<?
				if (!$g_userId) {
					echo '<a href="/xp/html/membership/" target="content">Login </a>';
					echo '| <a href="/xp/html/membership/index.php?page=register_form.php" target="content">Register</a>';
				} else {
					echo '<a href="javascript:logout();" target="content">Logout </a>';
				}
				?>
				<label for="region">Select region</label>
				<select title="language" id="region">
					<option value="1">U.S</option>
				</select>
			</div>
		</div>
		<div id="main_tab">
			<a href="main.php" target="content" style="display:block;float:left;width:200px;">:: Home ::</a>
			<a href="html/company" target="content">Company</a> | 
			<a href="html/business" target="content">Business</a> | 
			<a href="html/eStore" target="content">e-Store</a> | 
			<a href="html/helpCenter" target="content">Help Center</a> | 
			<a href="html/membership" target="content">Membership</a> | 
			<a href="html/myoffice" target="content">MyOffice</a>
		</div>
	</body>
</html>